<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org"
      th:replace="fragments/layout(title='用户管理-编辑',jsPaths='/static/js/system/user/add.js')">

<div class="right" th:fragment="right">
            <!--面包屑-->
            <div class="breadcrumb layui-bg-gray">
                    <span class="layui-breadcrumb" lay-separator=">">
                        <a th:href="@{/}">首页</a>
                         <a href="/organization">系统管理</a>
                        <a href="/user/ui/list">用户管理</a>
                        <a><cite>编辑</cite></a>
                    </span>
            </div>

            <!--主体内容区-->
            <div class="form-content layui-container">
                <form class="layui-form" action="/user/update" method="post">
                    <div class="layui-form-item">
                        <label class="layui-form-label must">姓名</label>
                        <div class="layui-input-block">
                            <input type="text" name="userName" maxlength="20" th:value="${user.userName}"   lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input">
                            <input type="hidden" name="id" th:value="${user.id}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label must">用户名</label>
                        <div class="layui-input-block">
                            <input type="text" name="userCode" th:value="${user.userCode}"    readonly="readonly" autocomplete="off" class="layui-input layui-disabled">
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <label class="layui-form-label must">手机号码</label>
                        <div class="layui-input-block">
                            <input type="text" name="phone" th:value="${user.phone}"  lay-verify="phone" placeholder="请输入手机号码" autocomplete="off" class="layui-input">
                        </div>
                        <div style="font-size: 12px;color:#b2b2b2;margin-top:0;padding-left:115px;">手机号可用于用户登陆与找回密码</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">邮箱</label>
                        <div class="layui-input-block">
                            <input type="text" name="email" th:value="${user.email}"   placeholder="请输入邮箱" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label must">角色</label>
                        <div class="layui-input-block">
                            <input th:each="role:${roles}"  type="text" th:if="${user.roleId} eq ${role.id}" th:value="${role.name}"  lay-verify="required" placeholder="角色" readonly autocomplete="off" class="layui-input layui-disabled">
                            <input type="text" th:if="${user.primary}" th:value="机构管理员"  lay-verify="required" placeholder="角色" readonly autocomplete="off" class="layui-input layui-disabled">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn  layui-btn-normal" lay-submit lay-filter="formDemo">保存</button>
                            <a href="/user/ui/list" class="layui-btn layui-btn-primary">返回</a>
                        </div>
                    </div>
                </form>

            </div>
        </div>
</html>